#ifndef CVERTEX_H
#define CVERTEX_H


class CEdge;
class CFace;
class CMesh;

// STD
#include <vector>

// PROJECT
#include "cedge.h"
#include "cface.h"
#include "cmesh.h"

class CVertex
{
public:
    CVertex();
    CVertex(const CVertex &);
    CVertex(double, double, double, CMesh * = NULL);
    CVertex(CPoint3f, CMesh * = NULL);

    double				getX();
    double				getY();
    double				getZ();
    CPoint3f			getPosition();
    double				getOriginalX();
    double				getOriginalY();
    double				getOriginalZ();
    CPoint3f			getOriginalPosition();
    CPoint3f			getNormal();
    bool				isNormalSet();
    CMesh *				getParentMesh();

    void				setX(double);
    void				setY(double);
    void				setZ(double);

    void				setPosition (double, double, double);
    void				setPosition (CPoint3f);
    void				setNormal (double, double, double);
    void				setNormal (CPoint3f);
    void				SetParentMesh(CMesh *);

    void				addEdge(CEdge *);
    void				addFace(CFace *);
    void				removeEdge(CEdge *);
    void				removeFace(CFace *);

    void				computeNormal();

    void				clearEdgelist();
    void				clearFaceList();

    std::vector<CEdge*>	m_vEdgeList;
    std::vector<CFace*>	m_vFaceList;
protected:
    CPoint3f			m_Position;
    CPoint3f			m_OriginalPosition;
    CPoint3f			m_Normal;

    bool				m_bNormalSet;

    CMesh *				m_pParentMesh;

};
#endif // CVERTEX_H
